Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxBitmapFont: Remove background of XNA fonts #2187

Merged
merged 1 commit into from
Nov 19, 2018

Conversation

Birdwards
Copy link
Contributor

When a FlxBitmapText uses a font that was created using FlxBitmapFont.fromXNA(), and the zoom of the current FlxCamera is a non-integer value, the background color that separates characters in the font's source image can sometimes appear between characters in the FlxBitmapText (see example here.) There is already code in place to remove this background color from the font, but it's currently restricted to the Flash target only, apparently due to crashes on other platforms. I removed the conditional check for Flash and tested FlxBitmapFont.fromXNA() on HTML5, Linux, Neko, and Windows; none of them crashed, and as desired, the background color no longer appears between the characters.

Performing bmd.threshold() with bgColor32 is necessary to prevent the background color from appearing between letters when a FlxBitmapText using this font is scaled by a non-integer value
@Gama11
Copy link
Member

Gama11 commented Nov 19, 2018

Thanks! I bet this was only an issue with some ancient OpenFL version.

@Gama11 Gama11 merged commit 4e2c026 into HaxeFlixel:dev Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants